using System.Runtime.CompilerServices;

namespace DanMuHelper.Logging
{
    using System;

    /// <summary>
    /// Exception日志
    /// </summary>
    public static class ExcpLog
    {
        public static void Log(this Exception excp,
            [CallerFilePath] string callerFilePath = "", [CallerMemberName] string callerMemberName = "")
        {
            Echo.Write(Echo.EchoType.Exception, excp, callerFilePath, callerMemberName);
        }

        public static void LogInContext(this Exception excp,
            UnityEngine.Object context,
            [CallerFilePath] string callerFilePath = "", [CallerMemberName] string callerMemberName = "")
        {
            Echo.WriteInContext(Echo.EchoType.Exception, context, excp, callerFilePath, callerMemberName);
        }
    }
}